<template>
  <div>
    <el-menu
      default-active="vue"
      class="el-menu-vertical-demo"
      @select="openHerf"
      @open="openHerf"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-submenu index="vue">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>Vue2.0</span>
        </template>
        <el-menu-item-group>
          <template slot="title">Vue基础</template>
          <el-menu-item index="zhiling">指令</el-menu-item>
          <el-menu-item index="smzq">生命周期</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-menu-item index="Jquery">
        <i class="el-icon-menu"></i>
        <span slot="title">JQuery</span>
      </el-menu-item>
      <el-menu-item index="xzq" disabled>
        <i class="el-icon-document"></i>
        <span slot="title">选择器</span>
      </el-menu-item>
      <el-menu-item index="dh">
        <i class="el-icon-setting"></i>
        <span slot="title">动画</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  methods: {
      openHerf(index){
        window.location.hash = index;
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
}
</script>

<style>

</style>